package com.yax.mickey.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yax.mickey.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author yax
* @description 针对表【category(商品分类表)】的数据库操作Mapper
* @createDate 2024-05-27 09:04:07
* @Entity com.yax.mickey.entity.Category
*/
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    @Select("select * from category")
    List<Category> getAllCategories();

    @Select("select * from category where category_id = #{categroyId}")
    Category getCategoryByCategoryId(Integer categoryId);

    @Select("select * from category where category_name = #{categoryName}")
    Category getCategoryByCategoryName(String categoryName);
}




